import http from '_u/http.js';

export default {
    // 配置相关
    getCopyright: function () {
        return http.get('/site/getCopyright');
    },
    // 用户相关
    login: function (data) {
        return http.post('/user/login', data);
    },
    passwordLogin: function (data) {
        console.log("执行2")
        return http.post('/user/passwordLogin', data);
    },
    logout: function () {
        return http.get('/user/logout');
    },


    bindBasicInfo: function (data) {
        return http.post('/user/bindBasicInfo', data);
    },
    bindBusiness: function (params) {
        return http.get('/user/bindBusiness', {params});
    },


    forgetPassword: function (data) {
        return http.post('/user/forgetPassword', data);
    },
    updateProfile: function (data) {
        return http.post('/user/updateProfile', data);
    },

    updateSession: function () {
        return http.get('/user/updateSession', );
    },


    sendVerificationCode: function (params) {
        return http.get('/user/sendVerifyMessage', {params}
        );
    },


    resetPassword: function (data) {
        return http.post('/user/resetPassword', data);
    },
    verifyEmail: function (params) {
        return http.get('/user/verifyEmail', {params});
    },
    getProfile: function () {
        return http.get('/user/getProfile')
    },
    getBusinessInfo: function () {
        return http.get('/user/getBusinessInfo')
    },


    getCaptcha: function () {
        return http.get('/user/getCaptcha');
    },
    isExist: function (params) {
        return http.get('/user/isExist', {params});
    },
    getParticipatedContests: function () {
        return http.get('/user/queryParticipateContest');
    },


    // 个人课程相关
    getUserCourseList: (params) => {
        return http.get('/course/user/page', {params}
        )
    },
}
